#include "detail.h"
#include "ui_detail.h"
#include <QDebug>
Detail::Detail(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Detail)
{
    ui->setupUi(this);
    // 获取charts单例并使用其按钮接口
    charts* chartUi = charts::getInstance(parent);

    // 获取按钮
    QPushButton* button = chartUi->widgetButton;
    QPushButton* button2 = chartUi->widget2Button;
    QPushButton* button3 = chartUi->widget3Button;
    QPushButton* button4 = chartUi->widget4Button;
    QPushButton* button5 = chartUi->widget5Button;
    QPushButton* button6 = chartUi->widget6Button;
    connect(ui->widget->getButton(),&QPushButton::clicked,button,&QPushButton::click);
    connect(ui->widget_2->getButton(),&QPushButton::clicked,button2,&QPushButton::click);
    connect(ui->widget_3->getButton(),&QPushButton::clicked,button3,&QPushButton::click);
    connect(ui->widget_4->getButton(),&QPushButton::clicked,button4,&QPushButton::click);
    connect(ui->widget_5->getButton(),&QPushButton::clicked,button5,&QPushButton::click);
    connect(ui->widget_6->getButton(),&QPushButton::clicked,button6,&QPushButton::click);
}

Detail::~Detail()
{
    delete ui;
}
